{{include template('public/header','admin')}}
<script type="text/javascript">

    function dosub(obj) {
        var reg = /^[A-Za-z]+$/;
        if (obj.name.value == '') {
            layer.msg("{{L('menu_name')}}不能为空！");
            return false;
        }
        $.ajax({
            type: 'POST',
            url: '/admin/menu/funall',
            data: $(obj).serialize(),
            dataType: "json",
            success: function (ret) {
                if (ret.status=="y") {
                    parent.location.reload();
                } else {
                    layer.msg(ret.info);
                }
            }
        });
        return false;
    }
</script>
</head>
<body>
    <div class="container">
        <div style="margin: 20px;">
            <form  method="post" class="form-horizontal" id="cpform" name="cpform" role="form" autocomplete='off' onsubmit="return dosub(this)" >
                <input type='hidden' name='id' value="{{$menu['id']}}" />
                <table class="table table-border ticky_table">
                    <tr>
                        <td>菜单名称:</td>
                        <td>{{$menu['name']}}</td>
                    </tr>
                    <tr>
                        <td>控制器路径:</td>
                        <td>{{$file}}</td>
                    </tr>
                    <tr>
                        <td>控制器方法:</td>
                        <td>
                            {{foreach $all_action as $item}}
                            <input type="checkbox"  name='action[]' value="{{$item}}" checked />{{L($item)}}
                            {{/foreach}}
                        </td>
                    </tr>
                    {{if $all_action }}
                    <tr>
                        <td></td>
                        <td>
                            <input type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;" class="btn btn-primary "/>
                        </td>
                    </tr>
                    {{/if}}
                </table>
                </from>
        </div>
    </div>
</body>
</html>